﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCS.Infrastructure.Dto.Models.Order;

namespace WCS.Infrastructure.Dto.Request.Order
{
    /// <summary>
    /// 创建订单请求对象
    /// </summary>
    public class OrderCreateRequestDto
    {
        /// <summary>
        /// 订单金额
        /// </summary>
        public long OrderAmount { get; set; }

        /// <summary>
        /// 收款码ID
        /// </summary>
        [StringLength(32)]
        public string CodeId { get; set; } = null!;

        /// <summary>
        /// 优惠券实例ID
        /// </summary>
        [StringLength(32)]
        public string? CouponInstanceId { get; set; }

        /// <summary>
        /// 支付方式（1=微信公众号，6=微信主扫支付，7=支付宝主扫支付，35=微信小程序，99=支付宝生活号）
        /// </summary>
        [StringLength(4)]
        public string PayMethod { get; set; } = "6";

        /// <summary>
        /// 商户支付结果展示地址
        /// </summary>
        [StringLength(256)]
        public string? RedirectUrl { get; set; }

        /// <summary>
        /// 买家的支付宝唯一用户号(userId)
        /// </summary>
        [StringLength(16)]
        public string? BuyerId { get; set; }

    }

    /// <summary>
    /// 小程序支付请求对象
    /// </summary>
    public class MiniProgramPaymentRequestDto
    {
        /// <summary>
        /// 商户订单号
        /// </summary>
        [StringLength(32)]
        public string OutTradeNo { get; set; }

        /// <summary>
        /// 平台商户编号
        /// </summary>
        [StringLength(32)]
        public string? CustomerCode { get; set; }

        /// <summary>
        /// 微信AppId
        /// </summary>
        public string? AppId { get; set; }

        /// <summary>
        /// 微信openId
        /// </summary>
        public string? OpenId { get; set; }

        /// <summary>
        /// 用户位置（经纬度）
        /// </summary>
        [StringLength(32)]
        public string? Location { get; set; }

        /// <summary>
        /// 统一下单的返回参数
        /// </summary>
        [StringLength(128)]
        public string OrderToken { get; set; }
    }
}
